package com.uestc.entity;

public class HuffmanNode implements Comparable<HuffmanNode> {
    public int freq;

    public Byte data;

    public boolean isLeaf;
    public HuffmanNode left;
    public HuffmanNode right;

    public HuffmanNode(Byte data, int freq) {
        this.data = data;
        this.freq = freq;
        this.isLeaf = true;
    }

    // 用于优先队列的比较
    @Override
    public int compareTo(HuffmanNode node) {
        return this.freq - node.freq;
    }
}